package pbl;

import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;


public class PersonServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		int serverPort = 6000;
	    ArrayList<Person> personList = new ArrayList<Person>();
	    ServerSocket serverSocket = new ServerSocket( serverPort );
	    System.out.println("PersonServer up and running...");
	    
	    while ( true ) {
	    	System.out.println("Waiting for client to connect...");
	    	Socket socket = serverSocket.accept(); // blocking call
	    	PersonHandler handler = new PersonHandler(socket, personList);
	    	new Thread(handler).start();
	    }
	}
}
